import axios from 'axios';


export const search = (params) => {
    return axios.post('/api/collections/search', {
        ...params
    })
}

export const adminLogin = (params) => {
    return axios.post('/api/staff/login', {
        ...params
    })
}

export const userRegister = (params) => {
    return axios.post('/api/user/register', {
        ...params
    })
}

export const userCaptcha = (userEmail, uuid) => {
    return axios.get('/api/user/captcha', {
        params: {
            userEmail: userEmail,
            uuid: uuid
        }
    })
}

export const userLogin = (params) => {
    return axios.post('/api/user/login', {
        ...params
    })
}

export const categorySearch = (params) => {
    return axios.get('/api/category/search', {
        ...params
    })
}

export const userDeleteSchedule = (params) => {
    return axios.post('/api/user/deleteschedule', {
        ...params
    })
}

export const userAddSchedule = (params) => {
    return axios.post('/api/user/addschedule', {
        ...params
    })
}

export const userSearchSchedule = (params) => {
    return axios.get('/api/user/searchschedule/' +
        params
    )
}

export const allSchedule = (params) => {
    return axios.post('/api/schedule/all', {
        ...params
    })
}

export const allNotice = () => {
    return axios.get('/api/notice/all')
}

export const addNotice = (params) => {
    return axios.post('/api/notice/add', {
        ...params
    })
}

export const allExhibits = () => {
    return axios.get('/api/exhibit/all')
}

export const addExhibit = (params) => {
    return axios.post('/api/exhibit/add', {
        ...params
    })
}

export const getExhibit = (params) => {
    return axios.get('/api/exhibit/id/' +
        params
    )
}

export const getCollections = (params) => {
    return axios.get('/api/CollectionsExhibit/get/' +
        params
    )
}

export const getMoment = () => {
    return axios.get('/api/moment/all')
}

export const addMoment = (params) => {
    return axios.post('/api/booking/add', {
        ...params
    })
}

export const allStaff = () => {
    return axios.get('/api/staff/search')
}

export const getUserExhibits = (params) => {
    return axios.get('/api/user/exhibits/' +
        params
    )
}

export const getUserExhibitsDetails = (params) => {
    return axios.get('/api/booking/get/' +
        params
    )
}

export const getAllFunctions = () => {
    return axios.get('/api/functions/all')
}

export const getFunctionsByDepart = (params) => {
    return axios.get('/api/functions/get/' +
        params
    )
}

export const getAllDepartment = () => {
    return axios.get('/api/department/all')
}

export const alertFunctions = (params) => {
    return axios.post('/api/functions/alter', {
        ...params
    })
}

export const getInternalNotice = (params) => {
    return axios.get('/api/internal/get/' +
        params
    )
}

export const addMission = (params) => {
    return axios.post('/api/mission/add', {
        ...params
    })
}

export const getMission = (params) => {
    return axios.get('/api/mission/get/' +
        params
    )
}

export const upImage = (params) => {
    return axios.post('/api/file/upload', params,
        {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        }
    )
}
